package com.ltkj.system.api;

import com.ltkj.common.core.constant.SecurityConstants;
import com.ltkj.common.core.constant.ServiceNameConstants;
import com.ltkj.common.core.domain.R;
import com.ltkj.system.api.domain.GameDataVo;
import com.ltkj.system.api.factory.RemoteGameDataFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 赛事服务
 * 
 * @author liupf
 */
@FeignClient(contextId = "remoteGameDataService", value = ServiceNameConstants.BASEPLATFORM_SERVICE, fallbackFactory = RemoteGameDataFallbackFactory.class)
public interface RemoteGameDataService
{
    /**
     * 通过id查询赛事信息
     *
     * @param id 赛事id
     * @param source 请求来源
     * @return 结果
     */
    @GetMapping("/game/detail")
    R<GameDataVo> getGameInfo(@RequestParam("id") Long id, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
    /**
     * 通过赛事id和userid删除赛事成员（取消订单调用）
     *
     * @param gameId 赛事id
     * @param userId 用户id
     * @param source 请求来源
     * @return 结果
     */
    @GetMapping("/game/del/member")
    R delGameMember(@RequestParam("gameId") Long gameId, @RequestParam("userId") Long userId,@RequestHeader(SecurityConstants.FROM_SOURCE) String source);

}
